Skip to main content

Calculate Charges Detail

POST : http://<base_url>/digipay/v3/transaction/calculate_charges

Calculate charges based on particular product code. Charges can be either included or excluded as per the company configuration. This API is only used for calculate customer and merchant charges.

BODY PARAMS:-

ParameterTypeDescriptionValue
profile_idStringunique id assigned to profile for which charges will be calculated116a51aa2b7d459a8b7e3db7dcf5e70a
currency_idStringunique id assigned to the currency in that currency charges will be calculatedb9a4cbeeedd340509cb1ac628cae2973
product_codeStringunique product_code assigned to the product for which product charges will be calculatedb9a4cbeeedd340509cb1ac628cae2973
txn_amountDoubletxh_amount on which charges will be calculated100
service_type_keyStringservice type key for define the key of servicewallet

HEADERS:-

ParameterTypeDescriptionValue
AuthorizationStringIt is a combination of type and token to authenticate user for the given tokenToken duik7309njdlkhdauhknksadhjkas986876sd873j
CompanyIDStringCompany_id is a unique primary id, that is represent company detail76bc712200ca444fa334f9e55e5fd7a8

Request Body:-

Request Example
curl --request POST \
--url http://192.168.1.102:8014/digipay/v3/transaction/calculate_charges \
--header 'Authorization: Token duik7309njdlkhdauhknksadhjkas986876sd873j' \
--header 'CompanyID: 7753ad6bd8cf48f5b1312fd21eb36588' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"profile_id": "116a51aa2b7d459a8b7e3db7dcf5e70a",
"currency_id": "116a51aa2b7d459a8b7e3db7dcf5e70a",
"product_code": "123",
"txn_amount": null,
"service_type_key": "wallet"
}
'

Response:-

Response 200(OK)

{
"success": 1,
"error": [],
"data": {
"charges_info": {
"total_charges" : 100,
"is_included" : true/false,
"charges": [
{
"charge_id": "12",
"charge_name": "Test",
"charge_type": 1,
"charge_value":12,
"charge_value_type": 2,
"final_charge": 125
},
{
"charge_id": "12",
"charge_name": "Test",
"charge_type": 1,
"charge_value":12,
"charge_value_type": 2,
"final_charge": 125
}
]
}
}
}
Response 400(BAD REQUEST)
{
"success": 0,
"error"": [1],
"data": {
"message": "BAD_REQUEST",
}
}

RESPONSES :-

Status CodeDescription
200OK
400BAD REQUEST
404NOT FOUND
500INTERNAL SERVER ERROR